<%@page import="com.util.Config"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<base href="<%= basePath %>">
	<%= Config.htmlMeta %>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script type="text/javascript" src="js/luck/luck.js"></script>
    <link rel="stylesheet" href="js/luck/skin/default/luck.css">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/pintuer.js"></script>
    <script type="text/javascript" src="js/respond.js"></script>
    <script type="text/javascript" src="js/admin.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <link type="image/x-icon" href="/favicon.ico" rel="shortcut icon" />
    <link href="/favicon.ico" rel="bookmark icon" />
    <script type="text/javascript" src="js/AutoEmail.js"></script>
    <style type="text/css">
    	.ben a:hover{color:#CC3300;text-decoration:underline;}
    	#myemail,.newemail,.newemailtitle{cursor:default;line-height:20px;}
    </style>
    <script type="text/javascript">
	    window.onload = function init(){
	    	var yhxhValue = getCookieValue("yhxh");
	    	if(yhxhValue.length > 0){
	    		 $("#yhxh").val(yhxhValue);  
	    	}
	    };
	    function zhmm(){
	    	if(checkForm()){
	    		$("#LoginButton").attr("class", "button button-block bg-main icon-refresh");
		    	$("#LoginButton").html("正在查找,请稍候");
		    	//Ajax进行登录
	            $.ajax({
	            	url: '<%=path %>/user/zhmm.action',
	            	type: 'POST',
	            	dataType : 'text',
	            	data: $("#form1").serialize(),
	            	success: function(msg){
	            	    if(msg == "已将密码发送至您的邮箱,请注意查收!"){
	            	    	luckA('200px', msg, 6);
	            	    	fhdl();
	            	    } else {
	            	    	$("#LoginButton").attr("class", "button button-block bg-main text-big");
		    		    	$("#LoginButton").html("找回密码");
	            	    	luckA('200px', msg, 5);
	            	    }
	            	},
	            	error: function(msg){
	            		$("#LoginButton").attr("class", "button button-block bg-main text-big");
	    		    	$("#LoginButton").html("找回密码");
	            		luckA('200px', '系统出现故障,请刷新页面重新登录!', 5);
	            	}
	            });
	    	}
	    }
	    function checkForm(){
	    	if(document.getElementById("yhxh").value == ""){
	    		luckA('200px', '登录账号不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("sjhm").value == ""){
	    		luckA('200px', '手机号码不能为空', 5);
	    		return false;
	    	} else if(!/^(13[0-9]|14[0-9]|15[0-9]|18[0-9])\d{8}$/i.test(document.getElementById("sjhm").value)){
	    		luckA('200px', '手机号码格式不正确', 5);
	    		return false;
	    	} else {
	    		return true;
	    	}
	    }
    </script>
</head> 
<body>
<div class="container">
    <div class="line">
        <div class="xs6 xm4 xs3-move xm4-move">
            <br /><br />
            <div class="media media-y">
                <a href="#"><img src="images/logo.png" class="radius"/></a>
            </div>
            <br /><br />
            <form action="" id="form1" name="form1" method="post">
	            <div class="panel" style="width: 400px;margin-left: auto;margin-right: auto;">
	                <div class="panel-head"><strong>找回密码</strong></div>
	                <div class="panel-body" style="padding:30px;">
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" name="yhxh" id="yhxh" maxlength="8" placeholder="登录账号" data-validate="required:请填写账号" />
	                            <span class="icon icon-user"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 8px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" onkeydown="chknum(this);" maxlength="11" name="sjhm" id="sjhm" placeholder="手机号码" data-validate="required:手机号码" />
	                            <span class="icon icon-phone"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 8px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" name="qq" onkeydown="chknum(this);" maxlength="11" id="qq" placeholder="QQ帐号"/>
	                            <span class="icon icon-qq"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 8px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" name="email" id="email" placeholder="邮箱" />
	                            <span class="icon icon-envelope"></span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                    	<div class="field" align="right">
	                    		&nbsp;<a href="#" onclick="fhdl();" style="text-decoration:none;font-size: 11px;">返回登录</a> 
								&nbsp;<a href="#" onclick="yjfk();" style="text-decoration:none;font-size: 11px;">意见反馈</a>
	                    	</div>
	                    </div>
	                </div>
	                <div class="panel-foot text-center" style="margin-top: -15px;">
	                	<button id="LoginButton" type="button" onclick="zhmm()" class="button button-block bg-main">找回密码</button>
	                </div>
	            </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
